package br.utfpr.edu.managedBean;

import java.io.IOException;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
import javax.faces.context.FacesContext;

import br.utfpr.edu.dao.AuthenticationDao;
import br.utfpr.edu.interfaces.IMenu;

@ManagedBean(name = "menuFrm")
@SessionScoped
public class MenuFrm extends ListaDetalhe<IMenu> {
	
	private static final long serialVersionUID = 8356366787708785278L;

	public void voltar(){
		try {
			FacesContext.getCurrentInstance().getExternalContext().redirect("../menu/menu.faces");
		} catch (IOException e) {
			imprimirErrosPagina(e+"");
		}
	}
	
	public void sair(){
		try {
			new AuthenticationDao().encerrarSessao();
			FacesContext.getCurrentInstance().getExternalContext().redirect("../index.faces");
		} catch (IOException e) {
			imprimirErrosPagina(e+"");
		}
	}

	@Override
	public void sort(String column, boolean ascending) {
		// TODO Auto-generated method stub
		
	}

}
